﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
    namespace="KojackGames.Blackjack.Acceptance.Tests.Utilities.TableObjects"
        assembly="KojackGames.Blackjack.Acceptance.Tests">

  <class name="BlackJackTableRow" table="BlackJackTables" lazy="false" >

    <id name="id" type="Guid">      
    </id>

    <version name="version" unsaved-value="0" />  
    
    <property name="player_token"/>    
    <property name="state_id"/>
    <property name="can_accept_bet"/>
    <property name="can_deal"/>
    <property name="finished"/>              
    <property name="state_name"/>
    <property name="cards_dealt"/>

    <bag name="deck_rows" table="Decks" lazy="false">
      <key column="blackjack_table_id"/>                              
      <composite-element class="KojackGames.Blackjack.Acceptance.Tests.Utilities.TableObjects.DeckRow">
        <property name="position_in_pack"/>
        <property name="suit"/>
        <property name="card_value"/>
      </composite-element>
    </bag>      
                  
    <bag name="hand_rows" inverse="true" cascade="all-delete-orphan" lazy="false" >
        <key column="blackjack_table_id"/>
        <one-to-many class="KojackGames.Blackjack.Acceptance.Tests.Utilities.TableObjects.HandTableRow"></one-to-many>
    </bag>      
      
  </class>

</hibernate-mapping>